<?php


namespace App\Utils\JWT;


class DataGet
{

    protected array $data = [];

    public function __get($key)
    {
        if (key_exists($key, $this->data)){
            return $this->data[$key];
        }
        return null;
    }

    public function __set($key, $val)
    {
        $this->data[$key] = $val;
    }

    public function toJson()
    {
        return json_encode($this->data);
    }

    public function append(array $data)
    {
        $this->data = array_merge($this->data,$data);
    }


}
